# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=wavemon
pkgver=0.9.6
pkgrel=1
pkgdesc="Ncurses-based monitoring application for wireless network devices"
url="https://github.com/uoaerg/wavemon"
arch="all"
license="GPL-2.0-or-later"
makedepends="ncurses-dev libcap-dev libnl3-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver-1.tar.gz::https://github.com/uoaerg/wavemon/archive/v$pkgver.tar.gz"
options="!check" # FIXME: run tests if possible!

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make CFLAGS="$CFLAGS -pthread -I/usr/include/libnl3"
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/share/$pkgname "$pkgdir"/usr/share/doc/
}

sha512sums="
1a96c8283678daf5c09cc60b5e264047c8f1075b1f43d95376550ccb016b75b2abaf00cd9b67873833d5834e0f86fa59e23186eaf9cda6040c66ebb913f8a729  wavemon-0.9.6-1.tar.gz
"
